<?php
/**
 * Created by PhpStorm.
 * User: tandunzhao
 * Date: 2018/5/30
 * Time: 下午1:42
 */

namespace App\Modules\Shop\Models;


use App\Modules\Order\Models\Order;
use Illuminate\Database\Eloquent\Model;

class OrderProducts extends Model
{
    protected $table = 'order_products';
    protected $fillable = ['id','ship_fee','order_id','uid','product_spec_id','product_id','price','count','amount','discount_rate','discount','created_at','updated_at','deliver_time','obtain_time','status','is_vip_product','is_gift','sub_trade_no'];

    public function order() {
        return $this->belongsTo(Order::class,'order_id');
    }

    public function product() {
        return $this->belongsTo(Products::class,'product_id');
    }

    public function product_specific() {
        return $this->belongsTo(ProductSpecifiction::class,'product_spec_id');
    }
}